﻿//using System;
//using System.Collections.Generic;
//using System.Text;
//using DCRF.Common.Core;
//using DCRF.Common.Primitive;
//using DCRF.Common.Interface;
//using System.Web.Hosting;
//using System.Web;
//using System.IO;
//using System.Reflection;
//using DCRF.Common.Helper;
//using System.Collections;
//using System.Web.Caching;
//using System.Web.UI;
//using DCRF.Common.Definition;

//namespace DCRF.BaseBlocks
//{
//    public abstract class WebCtlBlockBase : BlockBase
//    {
//        private string identifier = "";
//        protected string controlNamespace = "";
//        protected string controlName = "";
//        protected string codeFileClass = "";

//        public override void InitBlock(Guid ig)
//        {
//            base.InitBlock(ig);

//            identifier = this.BlockInfo.BlockID.Product + "." + this.BlockInfo.BlockID.Identifier;
//        }

//        public override void InitConnectors()
//        {
//            Connectors.CreateConnector("VPathProvider.RegisterVirtualFile", ConnectorType.Service);
//        }

//        protected override void onConnectorAttached(string key)
//        {
//            if (key == "VPathProvider.RegisterVirtualFile")
//            {
//                Connectors["VPathProvider.RegisterVirtualFile"].ProcessRequest(
//                    string.Format("~/{0}/{1}", identifier, controlName), 
//                    this.GetType(),
//                    string.Format("{0}.{1}", controlNamespace, controlName));

//                Connectors["VPathProvider.RegisterVirtualFile"].ProcessRequest(
//                    string.Format("~/{0}/{1}", identifier, codeFileClass),
//                    this.GetType(),
//                    string.Format("{0}.{1}", controlNamespace, codeFileClass));
//            }
//        }

//        [BlockService]
//        public virtual void BindToUI(Control container)
//        {
//            Control me = container.Page.LoadControl(string.Format("~/{0}/{1}", identifier, controlName));

//            container.Controls.Add(me);
//        }
//    }
//}
